//
//  HYLaunchViewController.m
//  Unidax
//
//  Created by victor lau on 2018/12/19.
//  Copyright © 2018 Unidax. All rights reserved.
//

#import "HYLaunchViewController.h"
#import "UIImage+GIF.h"
#import <JFBase/JFBase.h>
#import <JFKit/JFKit.h>

@interface HYLaunchViewController ()


@property (nonatomic,strong) UIImageView * imageView;

@end

@implementation HYLaunchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
  
    self.view.backgroundColor = [UIColor awColorWithHexString:@"#0f2952"];
   
    NSString *path = [[NSBundle mainBundle] pathForResource:@"hylaunch" ofType:@"gif"];
     //将图片转为NSData
     NSData *gifData = [NSData dataWithContentsOfFile:path];

     self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake((AWSCREEN_WIDTH-225)/2, 134, 225, 225)];
   
    
     self.imageView.backgroundColor = [UIColor awColorWithHexString:@"#0f2952"];
     self.imageView.image = [UIImage sd_animatedGIFWithData:gifData];

    
     [self.view addSubview:self.imageView];
    
    UIImageView * bottomImageView = [[UIImageView alloc] initWithFrame:CGRectMake((AWSCREEN_WIDTH-150)/2, AWSCREENH_HEIGHT-106, 150, 50)];
    bottomImageView.image = [UIImage imageNamed:@"launchlogo"];
    bottomImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.view addSubview:bottomImageView];
   
}


-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    AWWeakSelf(self)
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
     if (weakself.block) {
         weakself.block();
     }
       });
}

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

@end
